com.highdeal.pnr.hci
Class DetailTemplateModel

java.lang.Object
  extended by com.highdeal.pnr.hci.DetailTemplateModel
All Implemented Interfaces:
XMLMarshallable

public class DetailTemplateModel
extends java.lang.Object
implements XMLMarshallable

This class represents a detail template.

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:simpleType name="propertyDTType">
   <xs:restriction base="xs:string">
      <xs:enumeration value="string"/>
      <xs:enumeration value="number"/>
      <xs:enumeration value="date"/>
   </xs:restriction>
 </xs:simpleType>
  <xs:element name="detailTemplate">
   <xs:complexType>
    <xs:attribute name="name" type="xs:string"/>
    <xs:attribute name="type" type="propertyDTType"/>
    <xs:attribute name="defaultValue" type="xs:string"/>
    <xs:attribute name="propertyName" type="xs:string"/>
   </xs:complexType>
  </xs:element>


Constructor Summary
DetailTemplateModel()
          Builds an empty DetailTemplate.
DetailTemplateModel(java.lang.String name, int type, java.lang.Object defaultValue, java.lang.String propertyName)
          Builds a DetailTemplate.
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the object, the child representing the marshallable object which must be added to the element.
 DetailTemplateModel duplicate()
          Returns a new clone instance of this DetailTemplateModel
 java.lang.Object getDefaultValue()
          Returns the default value of the DetailTemplate.
 java.lang.String getName()
          Returns the name of the DetailTemplate.
 java.lang.String getPropertyName()
          Returns the name of the property mapped to this detail.
 int getType()
          Returns the type of the DetailTemplate.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, including its children.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the element being processed.
 void setDefaultValue(java.lang.Object defaultValue)
          Sets the value of the DetailTemplate.
 void setName(java.lang.String name)
          Set the name of the DetailTemplate
 void setPropertyName(java.lang.String propertyName)
          Returns the name of the DetailTemplate.
 void setType(int type)
          Set the type of the DetailTemplate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DetailTemplateModel

public DetailTemplateModel()
Builds an empty DetailTemplate.


DetailTemplateModel

public DetailTemplateModel(java.lang.String name,
                           int type,
                           java.lang.Object defaultValue,
                           java.lang.String propertyName)
Builds a DetailTemplate.

Parameters:
name - the name of the detail.
type - the type of the detail.
defaultValue - the default value (null if no default value) of the detail. This value must be compatible with the declared type. This value is taken if the propertyName is not found in the Rating Context.
propertyName - the mapped property name (null if no mapping required).
See Also:
Type.STRING, Type.NUMBER, Type.DATE
Method Detail

getName

public java.lang.String getName()
Returns the name of the DetailTemplate.

Returns:
the detail name.

setName

public void setName(java.lang.String name)
Set the name of the DetailTemplate

Parameters:
name - : name of the DetailTemplate.

getPropertyName

public java.lang.String getPropertyName()
Returns the name of the property mapped to this detail.

Returns:
the property name.

setPropertyName

public void setPropertyName(java.lang.String propertyName)
Returns the name of the DetailTemplate.

Parameters:
propertyName - the name of the mapped rating property. can be null if no mapping required.

getType

public int getType()
Returns the type of the DetailTemplate.

Returns:
the detail type.
See Also:
Type.STRING, Type.NUMBER, Type.DATE

setType

public void setType(int type)
Set the type of the DetailTemplate.

Parameters:
type - : The new type;

getDefaultValue

public java.lang.Object getDefaultValue()
Returns the default value of the DetailTemplate. According to the type, this value can be cast into :
  • java.math.BigDecimal for a NUMBER type.
  • java.util.Date for a DATE type.
  • java.lang.String for a STRING type.
  • Returns:
    the default value of the detail.
    See Also:
    Type.STRING, Type.NUMBER, Type.DATE

    setDefaultValue

    public void setDefaultValue(java.lang.Object defaultValue)
    Sets the value of the DetailTemplate.

    Parameters:
    defaultValue - the value of the DetailTemplate.
    See Also:
    getDefaultValue(), Type.STRING, Type.NUMBER, Type.DATE

    duplicate

    public DetailTemplateModel duplicate()
    Returns a new clone instance of this DetailTemplateModel

    Returns:
    a new intance of this DetailTemplateModel.

    addCharacterData

    public void addCharacterData(java.lang.String cData)
    Description copied from interface: XMLMarshallable
    Adds character data to the content element.

    Specified by:
    addCharacterData in interface XMLMarshallable
    Parameters:
    cData - The character data to be added

    setAttributes

    public void setAttributes(XMLAttributes atts)
    Description copied from interface: XMLMarshallable
    Sets the attributes of the XML representation of the element being processed.

    Specified by:
    setAttributes in interface XMLMarshallable
    Parameters:
    atts - The XML attributes of the current element

    addChild

    public void addChild(java.lang.String tagName,
                         XMLMarshallable child)
    Description copied from interface: XMLMarshallable
    Adds a child to the object, the child representing the marshallable object which must be added to the element.

    Specified by:
    addChild in interface XMLMarshallable
    Parameters:
    tagName - The name of tag for the child
    child - The child to be added

    marshal

    public void marshal(XMLOutputter output)
    Description copied from interface: XMLMarshallable
    Gives an XML representation of this object, including its children.

    Specified by:
    marshal in interface XMLMarshallable
    Parameters:
    output - The XML output to marshal the object into

    Document Published: October 2015 (SAP CC 4.0 SP10 and Later)